perm filename BNCH2.PL[PLC,LSP] blob
sn#763181 filedate 1984-08-03 generic text, type T, neo UTF8
% <OKUNO>BNCH2.PL.2, 7-Jul-84 11:36:03, Edit by OKUNO
% [8] **** Clause Indexing ****
/*
The following clauses are part of places database.
country(moscow,ussr). ===>220 clauses.
*/
:- public country/2.
:- public q81/1, q82/1, q83/1, q84/1, q85/1, q86/1.
/*
To optimize the compiled code, add the next declarations:
:- mode q81(-), q82(-), q83(-), q84(-), q85(-), q86(-).
:- fastcode.
:- compactcode.
*/
country(moscow,ussr).
country(novaya←zemlya,ussr).
country(sverdlovsk,ussr).
country(vladivostok,ussr).
country(gorki,ussr).
country(novosibirsk,ussr).
country(syracuse,usa).
country(new←york←city,usa).
country(ithaca,usa).
country(albany,usa).
country(san←francisco,usa).
country(san←diego,usa).
country(washington,usa).
country(boston,usa).
country(rome←ny,usa).
country(rome,italy).
country(paris,france).
country(london,uk).
country(dublin,ireland).
country(stockholm,sweden).
country(copenhagen,denmark).
country(amsterdam,netherlands).
country(brussels,belgium).
country(madrid,spain).
country(athens,greece).
country(ankara,turkey).
country(istanbul,turkey).
country(tirane,albania).
country(sofia,bulgaria).
country(belgrade,yugoslavia).
country(warsaw,poland).
country(prague,czechoslovakia).
country(lisbon,portugal).
country(tehran,iran).
country(delhi,india).
country(islamabad,pakistan).
country(tokyo,japan).
country(brisbane,australia).
country(canberra,australia).
country(wellington,new←zealand).
country(djakarta,indonesia).
country(singapore,singapore).
country(peking,china).
country(hanoi,vietnam).
country(seoul,south←korea).
country(pyong←yang,north←korea).
country(recife,brazil).
country(brasilia,brazil).
country(santiago,chile).
country(oslo,norway).
country(vancouver,canada).
country(ottawa,canada).
country(montreal,canada).
country(toronto,canada).
country(havana,cuba).
country(rio←de←janeiro,brazil).
country(san←paolo,brazil).
country(buenos←aires,argentina).
country(tierra←del←fuego,argentina).
country(punta←arenas,chile).
country(caracas,venezuela).
country(san←juan,usa).
country(tampa,usa).
country(rangoon,burma).
country(bonn,west←germany).
country(frankfurt,east←germany).
country(rotterdam,netherlands).
country(tashkent,ussr).
country(pretoria,south←africa).
country(bucharest,romania).
country(budapest,hungary).
country(vienna,austria).
country(bern,switzerland).
country(geneva,switzerland).
country(zurich,switzerland).
country(bangkok,thailand).
country(seattle,usa).
country(tahiti,unknown).
country(saigon,vietnam).
country(yokohama,japan).
country(pnom←penh,cambodia).
country(panama←canal,panama).
country(naples,italy).
country(honolulu,usa).
country(berlin,east←germany).
country(helsinki,finland).
country(reykjavik,iceland).
country(thule,greenland).
country(godthab,greenland).
country(kabul,afghanistan).
country(wigan,uk).
country(damascus,syria).
country(jerusalem,israel).
country(beirut,lebanon).
country(amman,jordan).
country(kuala←lumpur,malaysia).
country(lima,peru).
country(quito,ecuador).
country(la←paz,bolivia).
country(asuncion,paraguay).
country(montevideo,uruguay).
country(suez←canal,egypt).
country(cairo,egypt).
country(tripoli,libya).
country(tunis,tunisia).
country(algiers,algeria).
country(rabat,morocco).
country(nicosia,cyprus).
country(riyadh,saudi←arabia).
country(baghdad,iraq).
country(manila,philippines).
country(taipei,taiwan).
country(vientiane,laos).
country(shanghai,china).
country(chunking,china).
country(canton,china).
country(mukden,china).
country(bombay,india).
country(madras,india).
country(calcutta,india).
country(dacca,bangladesh).
country(kuwait,kuwait).
country(doha,qatar).
country(samarkand,ussr).
country(addis←ababa,ethiopia).
country(mogadiscio,somalia).
country(kampala,uganda).
country(khartoum,sudan).
country(sana,yemen←arab←republic).
country(nairobi,kenya).
country(tananarive,madagascar).
country(durban,south←africa).
country(cape←town,south←africa).
country(windhoek,namibia).
country(luanda,angola).
country(kinshasa,zaire).
country(brazzaville,congo).
country(usambura,burundi).
country(kigali,rwanda).
country(libreville,gabon).
country(yaounde,cameroon).
country(fort←lamy,chad).
country(bangui,central←african←empire).
country(lagos,nigeria).
country(porto←novo,benin).
country(lome,togo).
country(accra,ghana).
country(ouagadougou,upper←volta).
country(niamey,niger).
country(bamako,mali).
country(monrovia,liberia).
country(freetown,sierra←leone).
country(conakry,guinea).
country(bathurst,gambia).
country(dakar,senegal).
country(nouakchott,mauritania).
country(salisbury,zimbabwe←rhodesia).
country(lourenco←marques,mozambique).
country(darwin,australia).
country(lusaka,zambia).
country(timbuktu,mali).
country(mexico←city,mexico).
country(guatemala←city,guatemala).
country(tegucigalpa,honduras).
country(managua,nicaragua).
country(guantanamo,cuba).
country(kingston,jamaica).
country(port←au←prince,haiti).
country(santo←domingo,dominican←republic).
country(san←jose,costa←rica).
country(panama←city,panama).
country(san←salvador,el←salvador).
country(greenwich,uk).
country(omaha,usa).
country(denver,usa).
country(nassau,bahamas).
country(manama,bahrain).
country(bridgetown,barbados).
country(thimphu,bhutan).
country(gaborone,botswana).
country(bujumbura,burundi).
country(praia,cape←verde).
country(bogota,colombia).
country(moroni,comoro←islands).
country(djibouti,djibouti).
country(suva,fiji).
country(saint←georges,grenada).
country(bissau,guinea←bissau).
country(georgetown,guyana).
country(abidjan,ivory←coast).
country(maseru,lesotho).
country(vaduz,liechtenstein).
country(luxembourg,luxembourg).
country(blantyre,malawi).
country(male,maldives).
country(valetta,malta).
country(port←louis,mauritius).
country(monte←carlo,monaco).
country(ulan←bator,mongolia).
country(yaren,nauru).
country(katmandu,nepal).
country(muscat,oman).
country(port←moresby,papua←new←guinea).
country(san←marino,san←marino).
country(sao←tome,sao←tome←and←principe).
country(victoria,seychelles).
country(honiara,solomon←islands).
country(colombo,sri←lanka).
country(paramaribo,surinam).
country(mbabane,swaziland).
country(dar←es←salaam,tanzania).
country(nuku←alofa,tonga).
country(port←of←spain,trinidad←and←tobago).
country(abu←dhabi,united←arab←emirates).
country(apia,western←samoa).
country(aden,yemen).
country(andorra←la←vella,andorra).
country(cayenne,french←guiana).
country(pisa,italy).
country(gangtok,sikkim).
/*
[8-1:] Get the first clause with primary key.
do "q81(1000)." for one thousand iterations.
*/
q81(N) :-
statistics(garbage←collection,[←,←|G1]),!,
statistics(runtime,[←,←]),!,
loop←q81(0,N),
statistics(runtime,[←,T1]),!,
statistics(garbage←collection,[←,←|G2]),!,
statistics(runtime,[←,←]),!,
loop←dummy(0,N),
statistics(runtime,[←,T2]),
statistics(garbage←collection,[←,←|G3]),!,
G1 = [Gt1], G2 = [Gt2], G3 = [Gt3],
G4 is Gt2 + Gt2 - Gt1 - Gt3,
T3 is T1-T2-G4, Total is T1-T2,
write('Total = '), write(Total),
write('ms, runtime = '), write(T3),
write('ms, gctime = '), write(G4),
write('ms, for '), write(N), write(' iterations.'), nl.
loop←q81(N,N) :- !.
loop←q81(I,N) :-
I1 is I+1, country(moscow,X), !, loop←q81(I1,N).
loop←dummy(N,N) :- !.
loop←dummy(I,N) :-
I1 is I+1, !, loop←dummy(I1,N).
/*
[8-2:] Get the first clause.
do "q82(1000)." for one thousand iterations.
*/
q82(N) :-
statistics(garbage←collection,[←,←|G1]),!,
statistics(runtime,[←,←]),!,
loop←q82(0,N),
statistics(runtime,[←,T1]),!,
statistics(garbage←collection,[←,←|G2]),!,
statistics(runtime,[←,←]),!,
loop←dummy(0,N),
statistics(runtime,[←,T2]),
statistics(garbage←collection,[←,←|G3]),!,
G1 = [Gt1], G2 = [Gt2], G3 = [Gt3],
G4 is Gt2 + Gt2 - Gt1 - Gt3,
T3 is T1-T2-G4, Total is T1-T2,
write('Total = '), write(Total),
write('ms, runtime = '), write(T3),
write('ms, gctime = '), write(G4),
write('ms, for '), write(N), write(' iterations.'), nl.
loop←q82(N,N) :- !.
loop←q82(I,N) :-
I1 is I+1, country(X,ussr), !, loop←q82(I1,N).
/*
[8-3:] Get the last clause with primary key.
do "q83(1000)." for one thousand iterations.
*/
q83(N) :-
statistics(garbage←collection,[←,←|G1]),!,
statistics(runtime,[←,←]),!,
loop←q83(0,N),
statistics(runtime,[←,T1]),!,
statistics(garbage←collection,[←,←|G2]),!,
statistics(runtime,[←,←]),!,
loop←dummy(0,N),
statistics(runtime,[←,T2]),
statistics(garbage←collection,[←,←|G3]),!,
G1 = [Gt1], G2 = [Gt2], G3 = [Gt3],
G4 is Gt2 + Gt2 - Gt1 - Gt3,
T3 is T1-T2-G4, Total is T1-T2,
write('Total = '), write(Total),
write('ms, runtime = '), write(T3),
write('ms, gctime = '), write(G4),
write('ms, for '), write(N), write(' iterations.'), nl.
loop←q83(N,N) :- !.
loop←q83(I,N) :-
I1 is I+1, country(gangtok,X), !, loop←q83(I1,N).
/*
[8-4:] Get the last clause.
do "q84(1000)." for one thousand iterations.
*/
q84(N) :-
statistics(garbage←collection,[←,←|G1]),!,
statistics(runtime,[←,←]),!,
loop←q84(0,N),
statistics(runtime,[←,T1]),!,
statistics(garbage←collection,[←,←|G2]),!,
statistics(runtime,[←,←]),!,
loop←dummy(0,N),
statistics(runtime,[←,T2]),
statistics(garbage←collection,[←,←|G3]),!,
G1 = [Gt1], G2 = [Gt2], G3 = [Gt3],
G4 is Gt2 + Gt2 - Gt1 - Gt3,
T3 is T1-T2-G4, Total is T1-T2,
write('Total = '), write(Total),
write('ms, runtime = '), write(T3),
write('ms, gctime = '), write(G4),
write('ms, for '), write(N), write(' iterations.'), nl.
loop←q84(N,N) :- !.
loop←q84(I,N) :-
I1 is I+1, country(X,sikkim), !, loop←q84(I1,N).
/*
[8-5:] Get the middle clause with primary key.
do "q85(1000)." for one thousand iterations.
*/
q85(N) :-
statistics(garbage←collection,[←,←|G1]),!,
statistics(runtime,[←,←]),!,
loop←q85(0,N),
statistics(runtime,[←,T1]),!,
statistics(garbage←collection,[←,←|G2]),!,
statistics(runtime,[←,←]),!,
loop←dummy(0,N),
statistics(runtime,[←,T2]),
statistics(garbage←collection,[←,←|G3]),!,
G1 = [Gt1], G2 = [Gt2], G3 = [Gt3],
G4 is Gt2 + Gt2 - Gt1 - Gt3,
T3 is T1-T2-G4, Total is T1-T2,
write('Total = '), write(Total),
write('ms, runtime = '), write(T3),
write('ms, gctime = '), write(G4),
write('ms, for '), write(N), write(' iterations.'), nl.
loop←q85(N,N) :- !.
loop←q85(I,N) :-
I1 is I+1, country(manila,X), !, loop←q85(I1,N).
/*
[8-6:] Get the middle clause.
do "q86(1000)." for one thousand iterations.
*/
q86(N) :-
statistics(garbage←collection,[←,←|G1]),!,
statistics(runtime,[←,←]),!,
loop←q86(0,N),
statistics(runtime,[←,T1]),!,
statistics(garbage←collection,[←,←|G2]),!,
statistics(runtime,[←,←]),!,
loop←dummy(0,N),
statistics(runtime,[←,T2]),
statistics(garbage←collection,[←,←|G3]),!,
G1 = [Gt1], G2 = [Gt2], G3 = [Gt3],
G4 is Gt2 + Gt2 - Gt1 - Gt3,
T3 is T1-T2-G4, Total is T1-T2,
write('Total = '), write(Total),
write('ms, runtime = '), write(T3),
write('ms, gctime = '), write(G4),
write('ms, for '), write(N), write(' iterations.'), nl.
loop←q86(N,N) :- !.
loop←q86(I,N) :-
I1 is I+1, country(X,philippines), !, loop←q86(I1,N).